package cn.stylefeng.guns.sys.modular.system.mapper;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.entity.BtyPerformanceMonthInformation;
import cn.stylefeng.guns.sys.modular.system.model.params.AttendAuditBtyAreaParam;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyPerformanceMonthInformationPageListParam;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyPerformanceMonthInformationParam;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyPerformanceReceiveParam;
import cn.stylefeng.guns.sys.modular.system.model.result.BtyPerformanceMonthInformationResult;
import cn.stylefeng.guns.sys.modular.system.model.result.BtyPerformanceSelectResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wjk
 * @since 2022-02-10
 */
public interface BtyPerformanceMonthInformationMapper extends BaseMapper<BtyPerformanceMonthInformation> {

    /**
     * 获取列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    List<BtyPerformanceMonthInformationResult> customList(@Param("paramCondition") BtyPerformanceMonthInformationParam paramCondition);

    /**
     * 获取map列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") BtyPerformanceMonthInformationParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    Page<BtyPerformanceMonthInformationResult> customPageList(@Param("page") Page page, @Param("paramCondition") BtyPerformanceMonthInformationParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") BtyPerformanceMonthInformationParam paramCondition);
    /**
     * 根据 CheckId 获取 月度绩效详情信息;
     * @return
     */
    List<BtyPerformanceMonthInformation> getBtyPerformanceMonthInformationListPageByCheckId(@Param("paramCondition") BtyPerformanceMonthInformationParam param);
    /**
     * 根据店妖码，查询上个月的绩效信息
     *
     * @author wjk
     * @Date 2022-02-14
     */
    List<BtyPerformanceMonthInformation> getBtyPerformanceMonthInformation(@Param("paramCondition") BtyPerformanceReceiveParam param);

    /***
     * 编辑人员占比保存
     * @param param
     */

    Boolean updateZb(@Param("param") BtyPerformanceMonthInformationParam param);
    /**
     *
     * @param tempList
     */
    void addList(List<BtyPerformanceMonthInformation> tempList);

    /**
     *查询所有的姓名列表
     */
    Page<BtyPerformanceSelectResult> customPageListXm(@Param("page") Page pageContext, @Param("param") BtyPerformanceMonthInformationParam param);

    /**
     * 查询所有的营运经理
     */
    Page<BtyPerformanceSelectResult> customPageListYyjl(@Param("page") Page pageContext, @Param("param") BtyPerformanceMonthInformationParam param);

    /**
     *查询所有的督导
     */
    Page<BtyPerformanceSelectResult> customPageListDd(@Param("page") Page pageContext, @Param("param") AttendAuditBtyAreaParam param);

    /**
     *查询所有的督导
     */
    List<BtyPerformanceSelectResult> customListDd(@Param("param") AttendAuditBtyAreaParam param);



    /*
    查询所有店名
     */
    Page<BtyPerformanceSelectResult> customPageListDm(@Param("page") Page pageContext, @Param("param") AttendAuditBtyAreaParam param);
    /*
    查询绩效明细（带分页）
     */
    Page<BtyPerformanceSelectResult> customPage(@Param("page") Page pageContext, @Param("param") BtyPerformanceMonthInformationPageListParam param);

    /*
   查询绩效明细（不带分页）
    */
    List<BtyPerformanceSelectResult> customPage(@Param("param") BtyPerformanceMonthInformationPageListParam param);

    /*
    根据妖码，修改上个月绩效状态
     */
    Boolean updateByYm(@Param("param") BtyPerformanceMonthInformationPageListParam param);

    /*
    查询门店总数
    ws
     */
    Page<BtyPerformanceSelectResult> total(@Param("page") Page pageContext, @Param("param") BtyPerformanceMonthInformationPageListParam param);
    /*
    查询有绩效门店数
    ws
     */
    Page<BtyPerformanceSelectResult> PerformanceMd(@Param("page") Page pageContext1, @Param("param") BtyPerformanceMonthInformationPageListParam param);
    /*
    查询无绩效门店数
    ws
     */
    Page<BtyPerformanceSelectResult> NotperformanceMd(@Param("page") Page pageContext2, @Param("param") BtyPerformanceMonthInformationPageListParam param);

    /*
    查询已提交门店数
    ws
     */
    Page<BtyPerformanceSelectResult> SubmitMd(@Param("page") Page pageContext3, @Param("param") BtyPerformanceMonthInformationPageListParam param);

    /*
    查询未创建未提交的店的个数
     */
    Page<BtyPerformanceSelectResult> NotCreateMd(@Param("page") Page pageContext4,@Param("param") BtyPerformanceMonthInformationPageListParam param);

    /**
     * 查询已创建未提交的店的个数
     * @param pageContext6
     * @param param
     * @return
     */
    Page<BtyPerformanceSelectResult> createMd(@Param("page") Page pageContext6,@Param("param") BtyPerformanceMonthInformationPageListParam param);

    /*
    查询驳回店数
     */
    Page<BtyPerformanceSelectResult> Reject(@Param("page") Page pageContext5,@Param("param") BtyPerformanceMonthInformationPageListParam param);


    /**
     * 根据 CheckId 获取 月度绩效详情信息，包含被驳回的原因
     *
     * @author wjk
     * @Date 2022-04-06
     */
    List<BtyPerformanceMonthInformationResult> getBtyPerformanceMonthInformationListDismissedByCheckId(@Param("param") BtyPerformanceMonthInformationParam param);

    /**
     * 根据妖码，和时间，查询这个店的营运经理、督导
     * @param time
     * @param yaoma
     * @return
     */
    List<BtyPerformanceMonthInformation> getByYaoma(@Param("time") String time, @Param("yaoma") String yaoma);

    /**
     * 查询bty_performance_month_information表中是否有该店数据
     * @param time
     * @param yaoma
     * @param list
     * @return
     */
    List<BtyPerformanceMonthInformation> getByBh(@Param("time") String time, @Param("yaoma") String yaoma, @Param("list") List<BtyPerformanceMonthInformation> list);

    void updateByBh(@Param("param") BtyPerformanceMonthInformation information);

    /**
     * 查询营运经理审核通过的店的个数
     * @param pageContext7
     * @param param
     * @return
     */
    Page<BtyPerformanceSelectResult> pass(@Param("page") Page pageContext7, @Param("param") BtyPerformanceMonthInformationPageListParam param);
}
